waypoint* wpt = waypt_new();
wpt->latitude = enigmaPositionToDec(le_read32(&ewpt.latitude));
wpt->longitude = enigmaPositionToDec(le_read32(&ewpt.longitude));
- wpt->shortname = xstrndup(ewpt.shortname, ewpt.shortname_len);
- wpt->description = xstrndup(ewpt.longname, ewpt.longname_len);
+ char*sn = xstrndup(ewpt.shortname, ewpt.shortname_len);
+ wpt->shortname = sn;
+ xfree(sn);
+
+ char* ds = xstrndup(ewpt.longname, ewpt.longname_len);
+ wpt->description = ds;
+ xfree(ds);
+
switch (ewpt.waypoint_type) {
case WTYPE_WAYPOINT: // 0
case WTYPE_AIRPORT: // 1
tmp_track->line_color.opacity = 255;
// update track name
tmp_track->rte_name = trk_name;
+ xfree(trk_name);
track_add_head(tmp_track);
// This is the 1st coordinate of the track